package com.zhangxin.aiInterview.manager.redis.audio_speed;

import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 删除用户的语速记录
 */
@Component
public class DeleteAudioSpeed {
    
    @Resource
    private StringRedisTemplate stringRedisTemplate;

    /**
     * 删除指定用户的所有语速记录
     * @param userId 用户ID
     */
    public void deleteAllSpeedRecords(Long userId) {
        try {
            String key = "AI_interview:audioSpeed:" + userId;
            stringRedisTemplate.delete(key);
        } catch (Exception e) {
            System.out.println("Redis 删除语速记录失败: " + e.getMessage());
        }
    }
}